<template>
  <div>
    <template v-if="dsetId != null">
      <el-table :data="tableData" style="width: 100%" height="420" border header-row-class-name="tableHeadbg">
        <template v-for="item in headData">
          <el-table-column :key="item" :prop="item" :label="item">
          </el-table-column>
        </template>
      </el-table>
    </template>
  </div>
</template>

<script>
import request from '@/utils/request'

export default {
  name: 'dsetView',
  data() {
    return {
      tableData: [],
      headData: [],
      dsetId: null,
      dsid: null
    }
  },
  props: {},
  components: {},
  mounted() {

  },
  computed: {},
  methods: {
    loadData(dsetId, dsid) {
      this.dsetId = dsetId;
      request({
        url: "/bi/model/queryDataset",
        method: "get",
        params: {dsetId: dsetId, dsid: dsid},
      }).then(resp => {
        this.headData = resp.rows.header;
        this.tableData = resp.rows.datas;
        this.$forceUpdate();
      });
    }
  }
};
</script>

